<% @page_title="Registered Emails"%>

        <ul id="content_menu">
            <li id="offfocus"><a href="/profile/personal">Personal</a></li>
            <li id="offfocus"><a href="/profile/picture/">Picture</a></li>
			<li id="onfocus"><a href="/profile/email">Emails</a></li>
            <li id="offfocus"><a href="/profile/remove/">Remove Account</a></li>
        </ul>

<br><br>
<div id="content_title">Registered Emails</div>
<div id="content_body">
		<table id="listtable" width=600 align=center style="border-collapse:collapse;" >
			<tr>
				<th>Email</th>
				<th>Verified</th>
				<th>Primary</th>
				<th>Remove</th>
			</tr>
		<% @emails.each do |email|%>
		<tr>
			<td><%= email.email %></td>
			<td>
				<% if !email.is_verify%>
				<% form_tag ({:action=>"resend",:email=>email.email}) do%>
				<input type='image' src='/images/unverified.png' alt="Click to Resend Verification Code">  
				<% end%>
			<% else%>
			<img src="/images/verified.png">
			<% end%>
			</td>
			<td><% if !email.is_major%>
				<% form_tag ({:action=>"set_major",:email=>email.email}) do%>
				<input type='image' src='/images/secondary.png' alt="Click to Set Major of this email">  
				<% end%>
				<% else%>
				<img src="/images/primary.png">
				<% end%>
			</td>
			<td>
				<% form_tag ({:action=>"remove_email",:email=>email.email}) do%>
				<input type='image' src='/images/remove.png' alt="Click to Remove this email">  
				<% end%>
				</td>
		</tr>
		
		<% end%>
		</table>
</div>		
<br><br><br>
<div id="content_title">Add Emails</div>	
<div id="content_body">	
		<% form_tag :action=>'create' do%>
		<table width=400 align=center>
			<tr>
				<td><%= text_field_tag :email%></td>
				<td><%= submit_tag "Add Email"%></td>
			</tr>
		</table>
		<% end%>
</div>